//
//  MessageButton.m
//  Dresshere
//
//  Created by ZhangPeng on 2018/6/10.
//  Copyright © 2018年 张朋. All rights reserved.
//

#import "MessageButton.h"

@implementation MessageButton

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        if (!self.countLabel) {
            self.countLabel = [[UILabel alloc] initWithFrame:CGRectMake(frame.size.width - 21, 0, 17, 17)];
            self.countLabel.backgroundColor = [UIColor colorWithHexString:@"#D8C06F"];
            self.countLabel.textAlignment = NSTextAlignmentCenter;
            self.countLabel.font = [UIFont systemFontOfSize:12];
            self.countLabel.layer.cornerRadius = 17 / 2;
            self.countLabel.clipsToBounds = YES;
            self.countLabel.textColor = [UIColor whiteColor];
            self.countLabel.text = @"0";
            [self addSubview:self.countLabel];
            
            self.countLabel.hidden = YES;
        }
    }
    return self;
}

@end
